\(\int \cosh ^3(c+d x) (a+b \tanh ^2(c+d x)) \, dx\) [82]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 30 \[ \int \cosh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {a \sinh (c+d x)}{d}+\frac {(a+b) \sinh ^3(c+d x)}{3 d} \]

[Out]

a*sinh(d*x+c)/d+1/3*(a+b)*sinh(d*x+c)^3/d

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.048, Rules used = {3757} \[ \int \cosh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {(a+b) \sinh ^3(c+d x)}{3 d}+\frac {a \sinh (c+d x)}{d} \]

[In]

Int[Cosh[c + d*x]^3*(a + b*Tanh[c + d*x]^2),x]

[Out]

(a*Sinh[c + d*x])/d + ((a + b)*Sinh[c + d*x]^3)/(3*d)

Rule 3757

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_))^(p_.), x_Symbol] :> With[{ff = F
reeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 -
ff^2*x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n/2] && IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \left (a+(a+b) x^2\right ) \, dx,x,\sinh (c+d x)\right )}{d} \\ & = \frac {a \sinh (c+d x)}{d}+\frac {(a+b) \sinh ^3(c+d x)}{3 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.47 \[ \int \cosh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {a \sinh (c+d x)}{d}+\frac {a \sinh ^3(c+d x)}{3 d}+\frac {b \sinh ^3(c+d x)}{3 d} \]

[In]

Integrate[Cosh[c + d*x]^3*(a + b*Tanh[c + d*x]^2),x]

[Out]

(a*Sinh[c + d*x])/d + (a*Sinh[c + d*x]^3)/(3*d) + (b*Sinh[c + d*x]^3)/(3*d)

Maple [A] (verified)

Time = 1.90 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.23

method result size
derivativedivides \(\frac {a \left (\frac {2}{3}+\frac {\cosh \left (d x +c \right )^{2}}{3}\right ) \sinh \left (d x +c \right )+\frac {b \sinh \left (d x +c \right )^{3}}{3}}{d}\) \(37\)
default \(\frac {a \left (\frac {2}{3}+\frac {\cosh \left (d x +c \right )^{2}}{3}\right ) \sinh \left (d x +c \right )+\frac {b \sinh \left (d x +c \right )^{3}}{3}}{d}\) \(37\)
risch \(\frac {{\mathrm e}^{3 d x +3 c} a}{24 d}+\frac {{\mathrm e}^{3 d x +3 c} b}{24 d}+\frac {3 \,{\mathrm e}^{d x +c} a}{8 d}-\frac {{\mathrm e}^{d x +c} b}{8 d}-\frac {3 \,{\mathrm e}^{-d x -c} a}{8 d}+\frac {{\mathrm e}^{-d x -c} b}{8 d}-\frac {{\mathrm e}^{-3 d x -3 c} a}{24 d}-\frac {{\mathrm e}^{-3 d x -3 c} b}{24 d}\) \(116\)

[In]

int(cosh(d*x+c)^3*(a+b*tanh(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(a*(2/3+1/3*cosh(d*x+c)^2)*sinh(d*x+c)+1/3*b*sinh(d*x+c)^3)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.50 \[ \int \cosh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {{\left (a + b\right )} \sinh \left (d x + c\right )^{3} + 3 \, {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{2} + 3 \, a - b\right )} \sinh \left (d x + c\right )}{12 \, d} \]

[In]

integrate(cosh(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="fricas")

[Out]

1/12*((a + b)*sinh(d*x + c)^3 + 3*((a + b)*cosh(d*x + c)^2 + 3*a - b)*sinh(d*x + c))/d

Sympy [F]

\[ \int \cosh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\int \left (a + b \tanh ^{2}{\left (c + d x \right )}\right ) \cosh ^{3}{\left (c + d x \right )}\, dx \]

[In]

integrate(cosh(d*x+c)**3*(a+b*tanh(d*x+c)**2),x)

[Out]

Integral((a + b*tanh(c + d*x)**2)*cosh(c + d*x)**3, x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 83 vs. \(2 (28) = 56\).

Time = 0.20 (sec) , antiderivative size = 83, normalized size of antiderivative = 2.77 \[ \int \cosh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {b {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}^{3}}{24 \, d} + \frac {1}{24} \, a {\left (\frac {e^{\left (3 \, d x + 3 \, c\right )}}{d} + \frac {9 \, e^{\left (d x + c\right )}}{d} - \frac {9 \, e^{\left (-d x - c\right )}}{d} - \frac {e^{\left (-3 \, d x - 3 \, c\right )}}{d}\right )} \]

[In]

integrate(cosh(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="maxima")

[Out]

1/24*b*(e^(d*x + c) - e^(-d*x - c))^3/d + 1/24*a*(e^(3*d*x + 3*c)/d + 9*e^(d*x + c)/d - 9*e^(-d*x - c)/d - e^(
-3*d*x - 3*c)/d)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 84 vs. \(2 (28) = 56\).

Time = 0.30 (sec) , antiderivative size = 84, normalized size of antiderivative = 2.80 \[ \int \cosh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {a e^{\left (3 \, d x + 3 \, c\right )} + b e^{\left (3 \, d x + 3 \, c\right )} + 9 \, a e^{\left (d x + c\right )} - 3 \, b e^{\left (d x + c\right )} - {\left (9 \, a e^{\left (2 \, d x + 2 \, c\right )} - 3 \, b e^{\left (2 \, d x + 2 \, c\right )} + a + b\right )} e^{\left (-3 \, d x - 3 \, c\right )}}{24 \, d} \]

[In]

integrate(cosh(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="giac")

[Out]

1/24*(a*e^(3*d*x + 3*c) + b*e^(3*d*x + 3*c) + 9*a*e^(d*x + c) - 3*b*e^(d*x + c) - (9*a*e^(2*d*x + 2*c) - 3*b*e
^(2*d*x + 2*c) + a + b)*e^(-3*d*x - 3*c))/d

Mupad [B] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 74, normalized size of antiderivative = 2.47 \[ \int \cosh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {{\mathrm {e}}^{3\,c+3\,d\,x}\,\left (a+b\right )}{24\,d}-\frac {{\mathrm {e}}^{-3\,c-3\,d\,x}\,\left (a+b\right )}{24\,d}+\frac {{\mathrm {e}}^{c+d\,x}\,\left (3\,a-b\right )}{8\,d}-\frac {{\mathrm {e}}^{-c-d\,x}\,\left (3\,a-b\right )}{8\,d} \]

[In]

int(cosh(c + d*x)^3*(a + b*tanh(c + d*x)^2),x)

[Out]

(exp(3*c + 3*d*x)*(a + b))/(24*d) - (exp(- 3*c - 3*d*x)*(a + b))/(24*d) + (exp(c + d*x)*(3*a - b))/(8*d) - (ex
p(- c - d*x)*(3*a - b))/(8*d)